<?php
	echo"<table><tr><td colspan='3'>&nbsp;</td></tr>";
	echo"<tr><td colspan='3' class='judul'>&#187 Add Jenis</td></tr>";
	echo"<tr><td colspan='3' class='jarak_garis'><hr color='#6d6a69'>&nbsp;</hr></td></tr>";
	echo"<tr><td colspan='3'>&nbsp;</td></tr></table>";
	
	
	//Tampilkan ID ResepOtomatis
	$query=dbQuery("select max(id_jenis)as id_jenis from tbjenis")or die(mysql_error());
	$data=dbAssoc($query);
	//Gabung string - dengan data pada DB
	$explode=explode("-",$data['id_jenis']);
	$numeric=$explode[1];
	$obat=$numeric+1;
	//Panggil Fuction
	if(strlen($obat)==1){
			$id_customer="J-000".$obat;
		}elseif(strlen($obat)==2){
			$id_customer=="J-00".$obat;
		}elseif(strlen($obat)==3){
			$id_customer="J-0".$obat;
		}elseif(strlen($obat)==4){
			$id_customer="J-".$obat;
		}
	
?>

<form name="add_jenis" id="add_jenis" action="index_admin.php?index=result_jenis&cryption=<?php print $encode."*upn*".$santra.$random; ?>" method="post" enctype="multipart/form-data">
<table width="98%" border="0" cellspacing="0" cellpadding="5" class="tabel">
  <tr>
    <td width="250" class="form_insert">Id Jenis</td>
    <td width="395" class="jarak_form" > <input name="id_jenis" type="text" id="id_jenis" maxlength="5" readonly="readonly" value="<?php print $id_customer; ?>" size="25" class="form" size="50" > </td>
  </tr>
  
   <tr>
    <td class="form_insert">Nama Jenis</td>
    <td class="jarak_form" ><input type="text" name="nama_jenis"  id="nama_jenis" size="25" class="form"  /></td>
  </tr>
  <tr>
  <tr>
    <td class="isi_depan">&nbsp;</td>
    <td ><input type="submit" name="add_button_obat" class="button" value="Input Jenis Obat"  onclick="return valid_jenis();"></td>
  </tr>
  <tr>
  <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="3">&nbsp;</td>
  </tr>
</table>
</form>
